/*
 *  Licensed to the Apache Software Foundation (ASF) under one or more
 *  contributor license agreements.  See the NOTICE file distributed with
 *  this work for additional information regarding copyright ownership.
 *  The ASF licenses this file to You under the Apache License, Version 2.0
 *  (the "License"); you may not use this file except in compliance with
 *  the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */

package ant.antsys;
import java.util.ArrayList;
import java.util.Collection;

/**
 * this class is used to record test suite progress and results
 * @author johnson ma
 */
public class TestSuiteResult {

	private int numOfTestCase = 0;
	private int numOfFailed = 0;
	private int numOfRun = 0;
	private String testSuiteName;

	private float duration;

	ArrayList<TestCaseResult> results = new ArrayList<TestCaseResult>();

	public TestSuiteResult(String name) {
		testSuiteName = name;
	}

	public void addTestCaseResult(String caseName, float duration,
			boolean succeed, String errorMsg) {
		TestCaseResult caseResult = new TestCaseResult(caseName, duration,
				succeed, errorMsg);
		results.add(caseResult);
	}

	public void setNumOfTestCase(int value) {
		numOfTestCase = value;
	}

	public void setNumOfFailed(int value) {
		numOfFailed = value;
	}

	public void setNumOfRun(int value) {
		numOfRun = value;
	}

	public void setDuration(float value) {
		duration = value;
	}

	public String getTestSuiteName() {
		return testSuiteName;
	}

	public int getNumOfTestCase() {
		return numOfTestCase;
	}

	public int getNumOfFailed() {
		return numOfFailed;
	}

	public int getNumOfRun() {
		return numOfRun;
	}

	public float getDuration() {
		return duration;
	}

	public Collection<TestCaseResult> getResults() {
		return results;
	}

}
